package org.qiyu.live.api.websockerDemo;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;

/**
 * @ClassName: 发送端
 * @Description: TODO
 * @Author zhangguangyan
 * @Date 2023/09/02/ 10:48:06
 * @Version 1.0
 */
public class BioClient {
    public static void main(String[] args) throws IOException, InterruptedException {
        Socket socket = new Socket();
        socket.connect(new InetSocketAddress(9090));
        OutputStream outputStream = socket.getOutputStream();
        //发生数据
        while (true){
            outputStream.write("hello".getBytes());
            outputStream.flush();
            System.out.println("发送数据");
            Thread.sleep(1000);
        }
    }
}
